package com.zxy.ziems.collector.service;

import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

/**
 * 工作服务
 * @author 10348359
 * @create 2024-05-01 11:53
 */
@Service
public class WorkService implements ApplicationListener<ApplicationReadyEvent> {
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        try {
            service.requestConfig();
        } catch (SchedulerException e) {
            throw new RuntimeException(e);
        }
    }

    private ProcessConfigurationService service;

    @Autowired
    public void setService(ProcessConfigurationService processConfigurationService) {
        this.service = processConfigurationService;
    }
}
